# $Id: PKGBUILD 66330 2012-02-23 15:37:07Z lfleischer $
# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Judd Vinet <jvinet@zeroflux.org>

pkgname=tcsh
pkgver=6.18.01
pkgrel=1
pkgdesc='Enhanced version of the Berkeley C shell.'
arch=('i686' 'x86_64')
url='http://www.tcsh.org/Welcome'
license=('BSD')
depends=('ncurses')
backup=('etc/csh.cshrc'
        'etc/csh.login')
install='tcsh.install'
source=("ftp://ftp.astron.com/pub/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        'csh.cshrc'
        'csh.login')
md5sums=('6eed09dbd4223ab5b6955378450d228a'
         '7ca0fe6d1a1b9a0093f632499d4fb112'
         '4869b9da87c79854e2cc97241f125853')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure --prefix=/usr --sysconfdir=/etc --bindir=/bin
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  install -dm0755 "${pkgdir}/bin/"

  make DESTDIR="${pkgdir}" mandir=/usr/share/man install install.man

  install -Dm0644 "${srcdir}/csh.cshrc" "${pkgdir}/etc/csh.cshrc"
  install -Dm0644 "${srcdir}/csh.login" "${pkgdir}/etc/csh.login"
  install -Dm0644 Copyright "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  ln -s tcsh "${pkgdir}/bin/csh"
}
